#fourthfight.py
import combat

punch = combat.Attack('punch', (('d2', combat.DT.CRUSH),) )

knife = combat.Attack('knife', (('d4', combat.DT.PIERCE), ) )

#~ evasion = combat.Defense('evasion',
    #~ effect = combat.FX.DODGE)
    
glue = combat.Attack('glue', (('d0', combat.DT.NONE), ), effect = combat.FX.SLOWDOWN )

#~ muscles = combat.Attack('muscleup', (('d0', combat.FX.NONE), ), effect = combat.FX.STRONGER )
   
Harry = combat.Combatant('Harry', speed = 10)
Harry.ClearAttacks()

Sally = combat.Combatant('Sally', speed = 10)
Sally.ClearAttacks()
Sally.ClearDefenses()


Harry.AddAttack(punch, ["{name} swings at {opponent}.", "{name} swings"])
#~ Harry.AddAttack(muscles, ["Harry flexes to look like Charles Atlas.",])

#~ Sally.AddAttack(knife, ["Sally stabs {opponent}.",])
Sally.AddAttack(glue, ["Slow down {opponent}, you move to fast.", "Glue You!"])

#~ Sally.AddDefense(evasion, ["Sally ducks.", "Sally does the limbo under {opponent}'s attack."])

Manager = combat.CombatManager([Harry, Sally])
Manager.setOrderer(combat.InitiativeOrder, attribute = 'speed')
Manager.processcombat()